package com.ls.socketio.repository.dao;

import com.ls.socketio.bean.RoomAirConditionerInfo;
import com.ls.socketio.repository.RoomAirConditionerRepository;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author liShan
 * @date 2019/9/6 0:29
 */
@Component
public class RoomAirConditionerRepositoryImpl {

    @Resource
    private RoomAirConditionerRepository roomAirConditionerRepository;

    public void add(RoomAirConditionerInfo info){
        roomAirConditionerRepository.save(info);
    }

    /**
     * 根据房间id查询
     * @param roomId 房间id
     * @return 查询结果
     */
    public RoomAirConditionerInfo findByRoomId(Long roomId){
        return roomAirConditionerRepository.findByRoomId(roomId);
    }

}
